/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cn.com.sixboy.dao;

/**
 * @author Sam.Zheng <zcl1866@sina.com>
 * @date 2013-4-25 16:30:09
 * @version <v0.1>
 * @copyright SixBoy 封装查询实体条件
 */
public class QueryConditionEntity {
	private String jpql;
	private String[] conditionCoulmns;
	private DataType[] conditionCoulmnsTypes;
	private Object[] conditionValues;

	public String[] getConditionCoulmns() {
		return conditionCoulmns;
	}

	public void setConditionCoulmns(String[] conditionCoulmns) {
		this.conditionCoulmns = conditionCoulmns;
	}

	public DataType[] getConditionCoulmnsTypes() {
		return conditionCoulmnsTypes;
	}

	public void setConditionCoulmnsTypes(DataType[] conditionCoulmnsTypes) {
		this.conditionCoulmnsTypes = conditionCoulmnsTypes;
	}

	public Object[] getConditionValues() {
		return conditionValues;
	}

	public void setConditionValues1(Object[] conditionValues) {
		this.conditionValues = conditionValues;
	}

	public String getJpql() {
		return jpql;
	}

	public void setJpql(String jpql) {
		this.jpql = jpql;
	}

	/**
	 * JPQL语句中包含多个字段属性
	 * conditionCoulmns，conditionCoulmnsTypes，conditionValues数组索引要相一致
	 * 
	 * @param jpql
	 * @param conditionCoulmns
	 * @param conditionCoulmnsTypes
	 * @param conditionValues
	 */
	public QueryConditionEntity(String jpql, String[] conditionCoulmns,
			DataType[] conditionCoulmnsTypes, Object[] conditionValues) {
		this.jpql = jpql;
		this.conditionCoulmns = conditionCoulmns;
		this.conditionCoulmnsTypes = conditionCoulmnsTypes;
		this.conditionValues = conditionValues;
	}

	/**
	 * JPQL语句查询只有一个字段属性
	 * 
	 * @param jpql
	 * @param conditionCoulmn
	 * @param conditionCoulmnType
	 * @param conditionValue
	 */
	public QueryConditionEntity(String jpql, String conditionCoulmn,
			DataType conditionCoulmnType, Object conditionValue) {
		this.jpql = jpql;
		this.conditionCoulmns = new String[] { conditionCoulmn };
		this.conditionCoulmnsTypes = new DataType[] { conditionCoulmnType };
		this.conditionValues = new Object[] { conditionValue };

	}

}
